package light.mvc.model.wxn;

import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Transient;

import light.mvc.model.base.IdEntity;
import light.mvc.model.sys.OrganizationBO;

import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;

@Entity
@Table(name = "WXN_WEI_MENU")
@DynamicInsert(true)
@DynamicUpdate(true)
public class WeiMenuBO extends IdEntity implements java.io.Serializable {

	@Column(name = "IS_ENABLE")
	private Boolean isEnable; // 是否启用
	
	@Column(name = "NOTE")
	private String note; // 详情

	@Column(name = "MENU_TYPE")
	private Integer menuType; // 菜单类型

	@Column(name = "MENU_NAME", length = 50)
	private String menuName; // 菜单名称

	@Column(name = "MENU_EVENT", length = 50)
	private Integer menuEvent; // 菜单事件

	@Column(name = "GOTO_URL", columnDefinition = "VARCHAR(500)")
	private String gotoUrl; // 跳转至URL

	@Column(name = "MENU_SEQ")
	private Integer menuSeq; // 菜单序号
	
	private WeiMenuBO weiMenuBO;
	
	private Set<WeiMenuBO> weiMenuBOs = new HashSet<WeiMenuBO>(0);
	
	public WeiMenuBO() {
		super();
	}
	
	public WeiMenuBO(boolean isEnable,String note, Integer menuType,Integer menuEvent,String gotoUrl,Integer menuSeq,WeiMenuBO weiMenuBO,Set<WeiMenuBO> weiMenuBOs) {
		super();
		this.isEnable=isEnable;
		this.note=note;
		this.menuType=menuType;
		this.menuEvent=menuEvent;
		this.gotoUrl=gotoUrl;
		this.menuSeq=menuSeq;
		this.weiMenuBO=weiMenuBO;
		this.weiMenuBOs=weiMenuBOs;
	}
	
	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "pid")// 父菜单ID
	public WeiMenuBO getWeiMenuBO() {
		return weiMenuBO;
	}

	public void setWeiMenuBO(WeiMenuBO weiMenuBO) {
		this.weiMenuBO = weiMenuBO;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "weiMenuBO")
	public Set<WeiMenuBO> getWeiMenuBOs() {
		return weiMenuBOs;
	}

	public void setWeiMenuBOs(Set<WeiMenuBO> weiMenuBOs) {
		this.weiMenuBOs = weiMenuBOs;
	}
	
	

	public Boolean getIsEnable() {
		return isEnable;
	}

	public void setIsEnable(Boolean isEnable) {
		this.isEnable = isEnable;
	}

	public String getNote() {
		return note;
	}

	public void setNote(String note) {
		this.note = note;
	}

	public Integer getMenuType() {
		return menuType;
	}

	public void setMenuType(Integer menuType) {
		this.menuType = menuType;
	}

	public String getMenuName() {
		return menuName;
	}

	public void setMenuName(String menuName) {
		this.menuName = menuName;
	}

	public Integer getMenuEvent() {
		return menuEvent;
	}

	public void setMenuEvent(Integer menuEvent) {
		this.menuEvent = menuEvent;
	}

	public String getGotoUrl() {
		return gotoUrl;
	}

	public void setGotoUrl(String gotoUrl) {
		this.gotoUrl = gotoUrl;
	}

	public Integer getMenuSeq() {
		return menuSeq;
	}

	public void setMenuSeq(Integer menuSeq) {
		this.menuSeq = menuSeq;
	}

	
}
